﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace WmsApp.Util
{
    public class CloneObject
    {
        public static void CloneAllPropertyToAnthor<T>(T a,T  b)
        {
            PropertyInfo[] pis = typeof (T).GetProperties();
            foreach (var propertyInfo in pis)
            {
                if (propertyInfo.CanWrite)
                {
                    propertyInfo.SetValue(b, propertyInfo.GetValue(a, null), null);
                }

            }
        }
    }
}
